#ifndef TRANSF2D_H_INCLUDED
#define TRANSF2D_H_INCLUDED

typedef struct
{
    double elem[3][3];
} Mat3x3;

double Deg2Rad(int deg);

//=======================================================================
//Initializeaza o matrice de transformare asociata translatiei.
void InitTranslat(Mat3x3 *m, int tx, int ty);

//Initializeaza o matrice de transformare asociata rotatiei fata de origine.
void InitRot(Mat3x3 *m, int angle);

//Initializeaza o matrice de transformare asociata scalarii fata de origine.
void InitScale(Mat3x3 *m, double sx, double sy);

//Rotatia in jurul unui punct din plan
void InitRotPoint(Mat3x3 *m, int px, int py, int angle);

//Scalarea fata de un punct din plan
void InitScalePoint(Mat3x3 *m, int px, int py, double sx, double sy);
//=======================================================================

void matrix_display(Mat3x3 *m);

// R = A * B
// A = A * B or B = A * B if R == A or R == B respectively
void matrix_mult(Mat3x3 *r, Mat3x3 *a, Mat3x3 *b);

/*
    [t tx ty - translatie]
    [s px py sx sy - scalare]
    [r px py u - rotatie]
*/
int read_tsf(char *fileName, Mat3x3 *m);

#endif // TRANSF2D_H_INCLUDED
